<template>
  <div id="tops">
    <div class="topcons">
      <div class="ltop">金融市场业务风险管理系统</div>
      <div class="rtop">
        <span>您好，{{name}}</span>
        <span class="cus-t" @click="tochange">修改密码</span>
        <span class="cus-t" @click="quit">退出登录</span>
      </div>
    </div>  
  </div>
</template>

<script>
export default {
  name: 'top',
  data () {
    return {
      name: ''
    };
  },
  created () {
    let name = JSON.parse(sessionStorage.getItem('user')).name;
    this.name = name;
  },
  methods: {
    tochange () {
      this.$router.push('changePassword');
    },
    quit () {
      this.$router.push('/')
    }
  },
};
</script>

<style lang="scss">
  #tops {
    .topcons {
      height: 60px;
      width: 100%;
      background: linear-gradient(to right,#4A7894,#ADB6AF);
      display: flex;
      justify-content: space-between;
      color: white;
      .ltop {
        line-height: 60px;
        padding-left: 40px;
        font-size: 24px;
      }
      .rtop {
        line-height: 60px;
        padding-right: 40px;
        span {
          margin-right: 30px;
          &:last-child {
            margin-right: 0;
          }
          &.cus-t {
            cursor: pointer;
          }
        }

      }
    }
  }
</style>
